/*-----------------------------------------------------------------------------
| JupyterLab Pull Requests Style
|----------------------------------------------------------------------------*/

.jp-PullRequestPanel {
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--jp-layout-color0);
}

.jp-PullRequestButton {
  flex: 0 0 auto;
  background: none;
  line-height: 0px;
  padding: 0px 4px;
  width: 16px;
  border: none;
  outline: none;
  cursor: pointer;
}

.jp-PullRequestButton:active {
  transform: scale(1.272019649);
  overflow: hidden;
}

.jp-PullRequestButton:disabled {
  cursor: default;
}

.jp-PullRequestToolbar {
  flex: 0 0 auto;
  border-bottom: none;
  box-shadow: none;
  padding: 0;
}

.jp-PullRequestToolbar .jp-PullRequestToolbarHeader {
  padding: 0;
}

.jp-PullRequestToolbar .jp-PullRequestToolbarHeader h2 {
  font-size: var(--jp-ui-font-size0);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--jp-ui-font-color1);
  padding: 8px 12px;
  margin: 0;
  line-height: normal;
}

.jp-PullRequestToolbar .jp-PullRequestToolbarItem {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  padding: 2px 5px;
}

.jp-PullRequestBrowser {
  flex: 1 1 auto;
  background-color: var(--jp-layout-color1);
  margin: 0;
  font-size: var(--jp-ui-font-size1);
  overflow-y: auto;
}

.jp-PullRequestBrowser ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

.jp-PullRequestBrowserGroup header {
  flex: 0 0 auto;
  align-items: center;
  height: 28px;
  display: flex;
  border-bottom: var(--jp-border-width) solid var(--jp-border-color2);
  padding-top: 8px;
}

.jp-PullRequestBrowserGroup header h2 {
  font-size: var(--jp-ui-font-size0);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--jp-ui-font-color1);
  padding: 8px 8px 8px 12px;
  margin: 0;
}

.jp-PullRequestBrowserItemListItem {
  display: flex;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: auto;
}

.jp-PullRequestBrowserItemListItem:hover {
  background-color: var(--jp-layout-color2);
}

.jp-PullRequestBrowserItemListItem h2 {
  font-size: var(--jp-ui-font-size1);
  color: var(--jp-ui-font-color1);
  font-weight: 400;
  padding: 4px 4px 4px 12px;
  margin: 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jp-PullRequestBrowserItemListItemIconWrapper {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  padding: 4px 12px 4px 4px;
}

.jp-PullRequestBrowserItemListItemIconWrapper button:hover svg .jp-icon3[fill] {
  fill: var(--jp-inverse-layout-color2);
}

.jp-PullRequestBrowserItemListItem span {
  margin: 0;
}

.jp-PullRequestBrowserFileItem {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  padding: 4px 12px 4px 12px;
  color: var(--jp-ui-font-color1);
}

.jp-PullRequestBrowserFileItem:hover {
  background-color: var(--jp-layout-color2);
}

.jp-PullRequestBrowserFileItemChanged {
  color: var(--jp-ui-font-color2);
  font-size: 10px;
  height: 10px;
  margin-left: 5px;
}

.jp-PullRequestBrowserGroupError {
  font-size: var(--jp-ui-font-size0);
  font-weight: 400;
  letter-spacing: 1px;
  padding: 4px 12px 4px 12px;
  margin: 0;
  line-height: normal;
  background: var(--jp-rendermime-error-background);
  color: #e75c58;
}

.jp-PullRequestTab {
  width: 100%;
  height: 100%;
  overflow: auto;
}

.jp-PullRequestTab > .lm-Widget {
  height: 100%;
  margin: auto;
}

.jp-PullRequestDescriptionTab {
  /* Cancel default hidden on widget */
  overflow: unset;
  max-width: 930px;
  padding: 0px 10px;
}

.jp-PullRequestDescriptionHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.jp-PullRequestDescriptionHeader * {
  margin-top: 8px !important;
  margin-bottom: 8px !important;
}

.jp-PullRequestDescriptionHeader h1 {
  font-size: var(--jp-ui-font-size3);
  color: var(--jp-ui-font-color0);
  font-weight: 600;
}

.jp-PullRequestDescriptionHeader h2 {
  font-size: var(--jp-ui-font-size);
  color: var(--jp-ui-font-color2);
  font-weight: 400;
}

.jp-PullRequestTabError {
  font-size: var(--jp-ui-font-size1);
  font-weight: 400;
  letter-spacing: 1px;
  padding: 20px;
  margin: 0;
  line-height: normal;
  background: var(--jp-rendermime-error-background);
  text-align: center;
  color: #e75c58;
}

.jp-PullRequestComment {
  background-color: var(--jp-layout-color1);
  padding: 4px;
  border-top: var(--jp-border-width) solid var(--jp-border-color0);
  box-shadow: 0 var(--jp-border-width) 0 var(--jp-border-color0); /* prevents double border */
}

.jp-PullRequestComment .jp-PullRequestInputContainer {
  padding: 8px 16px;
  font-size: var(--jp-ui-font-size1);
  font-weight: 400;
}

.jp-PullRequestInputButtonContainer {
  display: flex;
  flex: 1;
  justify-content: flex-end;
}

.jp-PullRequestInputButtonContainer button {
  margin-top: 4px;
  margin-left: 4px;
}

.jp-PullRequestInputContainer
  button.jp-Button-flat.jp-mod-styled.jp-mod-accept:disabled {
  opacity: 0.4;
}

.jp-PullRequestGrayedText {
  color: var(--jp-ui-font-color2);
}

.jp-PullRequestThread {
  display: flex;
  margin: 10px 0px;
  flex-direction: column;
  border: var(--jp-border-width) solid var(--jp-border-color0);
  border-radius: 5px;
  box-shadow: var(--jp-elevation-z2);

  background-color: var(--jp-layout-color0);
  font-family: var(--jp-ui-font-family);
  font-size: var(--jp-ui-font-size1);
  color: var(--jp-ui-font-color1);
}

.jp-PullRequestExpandButton {
  position: absolute;
  left: 2px;
  top: 6px;
  width: 20px;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 0px;
  outline: none;
  padding: 0px;
  z-index: 1;
}

.jp-PullRequestExpandButton svg {
  width: 20px;
}

.jp-PullRequestExpandButton:hover .jp-icon3[fill] {
  fill: var(--jp-inverse-layout-color2);
}

.jp-PullRequestCommentItem {
  padding: 8px;
  padding-left: 22px;
  border-bottom: 1px solid var(--jp-border-color2);
}

.jp-PullRequestCommentItem:last-of-type {
  background-color: var(--jp-layout-color2);
  border-bottom: none;
}

.jp-PullRequestCommentItemContent {
  margin-left: 33px;
  display: block;
}

.jp-PullRequestReplyButton {
  font-size: var(--jp-ui-font-size1);
  background-color: var(--jp-layout-color1);
  border: var(--jp-border-width) solid var(--jp-border-color0);
  background-position: right 8px center;
  background-repeat: no-repeat;
  border-radius: 3px;
  line-height: 20px;
  outline: none;
  padding: 6px 8px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  cursor: text;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* Thread title */
p.jp-PullRequestCommentItemContentTitle {
  color: var(--jp-ui-font-color1);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.jp-PullRequestCommentItemContentTitle strong {
  font-weight: 600;
  margin-right: 8px;
}

/* Thread Avatar */
.jp-PullRequestCommentItemImg {
  position: absolute;
}

.jp-PullRequestCommentItemImg img {
  height: 28px;
  width: 28px;
  border-radius: 14px;
}

/* Comment editor */
.jp-PullRequestCommentItemContent > .CodeMirror,
.CodeMirror-merge .jp-PullRequestCommentItemContent > .CodeMirror,
.nbdime-root .jp-PullRequestCommentItemContent > .CodeMirror.cm-s-jupyter {
  height: 140px !important;
  border: var(--jp-border-width) solid var(--jp-cell-editor-border-color);
  border-radius: 0px;
  background-color: var(--jp-layout-color0);
}

.jp-PullRequestCommentItemContent > .CodeMirror-focused,
.CodeMirror-merge .jp-PullRequestCommentItemContent > .CodeMirror-focused,
.nbdime-root
  .jp-PullRequestCommentItemContent
  > .CodeMirror-focused.cm-s-jupyter {
  border: var(--jp-border-width) solid var(--jp-cell-editor-active-border-color);
  box-shadow: var(--jp-input-box-shadow);
}

.jp-PullRequestCommentItemContent > .CodeMirror-empty {
  color: var(--jp-ui-font-color2);
}

/* Notebook diff styles */
.jp-PullRequestCellDiff {
  overflow: visible;
  margin: 5px 0px;
  padding-right: 4px;
}

.jp-PullRequestCellDiff.jp-git-unchanged {
  cursor: pointer;
  color: var(--jp-ui-font-color1);
  background: var(--jp-layout-color2);
  border: 1px solid var(--jp-border-color1);
  font-size: 90%;
  width: calc(100% - 32px);
  border-radius: 4px;
  text-align: center;
}

.jp-PullRequestCellDiff.jp-git-unchanged[data-pullrequest-hasthread]::before {
  content: 'Hidden cell with ' attr(data-pullrequest-hasthread) ' discussions.';
}

.jp-PullRequestCellDiff.jp-git-unchanged::before {
  content: '(...)';
}

.jp-PullRequestCellDiff.jp-git-unchanged > * {
  display: none;
}

.jp-PullRequestCellDiffContent {
  display: flex;
  overflow: visible;
}

.jp-PullRequestCellDiffContent > .lm-Widget:first-child {
  flex: 1 1 auto;
}

.jp-PullRequestCellDiffCommentContainer {
  width: 16px;
  margin-right: 8px;
  margin-left: 8px;
  flex: 0 0 auto;
  overflow: visible;
}

.jp-PullRequestCellDiffComment {
  width: 100%;
  height: 100%;
  border: 2px solid var(--jp-brand-color1);
  border-radius: var(--jp-border-radius);
  border-left: 0;
  transition: all 0.2s ease-in-out;
  display: flex;
  align-items: center;
}

.jp-PullRequestCellDiffComment:hover {
  border-width: 3px;
}

.jp-PullRequestCellDiffComment:hover .jp-PullRequestCommentDecoration {
  transform: scale(1.1);
}

.jp-PullRequestCellDiffComment .jp-PullRequestCommentDecoration {
  flex: 0 0 auto;
  margin-left: 8px;
}

/* Plain text diff */
.CodeMirror-gutter.jp-PullRequestCommentDecoration,
.CodeMirror-gutter-elt > .jp-PullRequestCommentDecoration {
  background: transparent;
  width: 18px !important;
  height: 18px !important;
}

.jp-PullRequestCommentDecoration,
.CodeMirror-gutter-elt > .jp-PullRequestCommentDecoration:hover {
  background-image: url(icons/pullrequest-plus.svg),
    linear-gradient(var(--jp-brand-color1), var(--jp-brand-color1));
  border-radius: var(--jp-border-radius);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 18px !important;
  height: 18px !important;
  margin-left: 2px;
  z-index: 1;
  transition: all 0.2s ease-in-out;
}

.jp-PullRequestTab .jp-git-diff-root .cm-s-jupyter .CodeMirror-gutters {
  background-color: var(--jp-layout-color2);
}

/* Notebook and Plain text diff common */
.jp-PullRequestCommentDecoration:hover {
  transform: scale(1.2);
}
